package com.beiding.t;

import com.alibaba.fastjson.JSON;
import com.beiding.jsonanalyzer.Analyzer;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 丁常磊
 * @date 2022/3/23 9:55
 */

public class 拉取Dataphin文件 {

    public static final String BASE_URL = "http://dataphin.lushang.com.cn";

    public static final String COOKIE = "dataphin-locale=zh_CN; DPN-OAUTH-SESSION=NTFhOGQ4MmYtZmM1OS00ODMxLWE3N2MtNzUzNjNmZjYwYzE2; dataphin-env=vpc; cluster=online_cluster";


    public static void main(String[] args) {


        System.out.println(Long.parseLong("012"));

    }

    public static final Map<String, String> BASE_HEADER = new HashMap<>();

    static {

        String k = "accept: application/json\n" +
                "Accept-Encoding: gzip, deflate\n" +
                "Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6\n" +
                "Cache-Control: no-cache\n" +
                "Connection: keep-alive\n" +
                "env: DEV\n" +
                "Host: dataphin.lushang.com.cn\n" +
                "model: DEV_PROD\n" +
                "Pragma: no-cache\n" +
                "Referer: http://dataphin.lushang.com.cn/dev/?projectId=20847&env=DEV\n" +
                "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.46";


        String[] split = k.split("\n");

        for (String line : split) {
            int i = line.indexOf(":");

            String key = line.substring(0, i).trim();
            String value = line.substring(i + 1).trim();

            BASE_HEADER.put(key, value);
        }

    }

    /*public static Analyzer getReq(String path) {

        RestTemplate restTemplate = new RestTemplate();
        HttpHeaders httpHeaders = new HttpHeaders();

        BASE_HEADER.forEach(httpHeaders::set);

        restTemplate.getForObject(BASE_URL+path,)

    }*/


}
